home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
256
< prev
next >
Wrap
Text File
|
1996-08-06
|
1KB
|
38 lines
Path: bga.com!news
From: makuch@bga.com (Michael Makuch)
Newsgroups: comp.lang.c,comp.os.ms-windows.nt.misc,comp.programming,comp.std.c,comp.unix.aix
Subject: function pointers
Date: 31 Jan 1996 19:40:07 GMT
Organization: Real/Time Communications - Bob Gustwick and Associates
Message-ID: <4eogio$gt0@giga.bga.com>
Mime-Version: 1.0
X-RTcode: e791096531976b7d560fc565
X-Newsreader: WinVN 0.99.4
The following c code segment compiles and works on
NT MSVC++ and on SVR4 C compiler, but errors out
on AIX with a type mismatch;
struct foostruct1 * myfoo1();
struct foostruct2 * myfoo2();
void *(*ptr)();
ptr = myfoo1;
[snip]
ptr = myfoo2;
I'm passing the function pointer ptr, to a function
which then calls myfoo1, myfoo2, etc., etc. I can think
of several work arounds but I'd rather get the AIX
compiler to accept it. Is there a portable solution to
get the AIX compiler to accept it? Casting the assignment
as
prt = (struct foostruct1 *)myfoo1;
doesn't work either.
Thanx for any clues.
mkm@abm.austin.tx.us